<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Logout extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
        $this->load->helper('cookie');
	}
	
	public function index()
	{
        $this->session->unset_userdata('username');
		$this->session->unset_userdata('uid');
		$this->session->unset_userdata('access');
        $this->session->unset_userdata('allianceid');
        $this->session->sess_destroy();
        
        delete_cookie('username','','/','ww_');
        delete_cookie('password','','/','ww_');
        
        redirect(site_url("login"));
	}
}